package br.com.winesys.geta.databinding.componentBinder;

import javax.swing.JLabel;
import br.com.winesys.geta.databinding.ComponentBinder;

public final class JLabelBinder implements ComponentBinder<JLabel> {

	private static final ComponentBinder <JLabel>INSTANCE = new JLabelBinder();

	public static ComponentBinder<JLabel> getInstance() {
		return INSTANCE;
	}

	private JLabelBinder() {
	}

	@Override
	public Object read(JLabel component) {
		return component.getText();
	}

	@Override
	public void write(JLabel component, Object value) {
		if (value == null) {
			component.setText("");
		} else {
			component.setText(value.toString());
		}
	}
}
